revert(coding-agent): restore subagent cleanup guidance - #1955
Merged
Merged
Conversation
Reverts #1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy.
snimu
approved these changes
Sep 1, 2026
paralin
pushed a commit
to paralin/prime-agent
that referenced
this pull request
Sep 2, 2026
…ct-ai#1955) * revert(coding-agent): restore subagent cleanup guidance Reverts PrimeIntellect-ai#1952 so agents delete direct subagents when they are no longer needed instead of retaining them until a user explicitly requests deletion. Adds prompt coverage for the intended cleanup policy. * test(coding-agent): keep prompt rollback free of copy assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Requiring an explicit user request for every deletion causes completed subagent sessions to accumulate and retain memory. Cleanup should remain the default once a direct subagent is no longer needed.
Validation
test/system-prompt.test.ts: 25 passedgit diff --check: passednpm run check: Biome passed; the local typecheck could not resolve pre-existing workspace dependencies (@smithy/types,@smithy/node-http-handler,@anthropic-ai/sdk, andgrok-mermaid). CI will run in the complete repository environment.Linear: ENG-5836
Note
Low Risk
Prompt-only change that nudges model behavior around subagent lifecycle; no runtime API or security surface changes.
Overview
Reverts #1952 and restores default subagent cleanup in the RLM harness system prompt.
In
buildRlmPrompt(rlm.ts), the guidance forrlm.delete_subagentagain tells parent agents to delete direct children when they are no longer needed, instead of limiting deletion to explicit user requests. The unreleased changelog note that documented the user-only policy is removed.This is intended to stop finished subagent sessions from accumulating and holding memory when parents never get a delete instruction from the user.
Reviewed by Cursor Bugbot for commit 8f91731. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore subagent deletion guidance in
buildRlmPromptReverts the child-agent doctrine in rlm.ts so the prompt says to delete a direct child with
await rlm.delete_subagent(child)when it is no longer needed, instead of only on explicit user request. Removes the now-obsolete changeset fileprompt-subagent-deletion-user-only.md.Macroscope summarized 8f91731.